home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Personal Computer World 2009 February
/
PCWFEB09.iso
/
Software
/
Resources
/
Chat & Communication
/
Digsby build 37
/
digsby_setup.exe
/
lib
/
PIL
/
ImtImagePlugin.pyo
(
.txt
)
< prev
next >
Wrap
Python Compiled Bytecode
|
2008-10-13
|
2KB
|
59 lines
# Source Generated with Decompyle++
# File: in.pyo (Python 2.5)
__version__ = '0.2'
import string
import re
import Image
import ImageFile
field = re.compile('([a-z]*) ([^ \\r\\n]*)')
class ImtImageFile(ImageFile.ImageFile):
format = 'IMT'
format_description = 'IM Tools'
def _open(self):
if '\n' not in self.fp.read(100):
raise SyntaxError, 'not an IM file'
self.fp.seek(0)
xsize = ysize = 0
while None:
s = self.fp.read(1)
if not s:
break
if s == chr(12):
self.tile = [
('raw', (0, 0) + self.size, self.fp.tell(), (self.mode, 0, 1))]
break
continue
s = s + self.fp.readline()
if len(s) == 1 or len(s) > 100:
break
if s[0] == '*':
continue
m = field.match(s)
if not m:
break
(k, v) = m.group(1, 2)
if k == 'width':
xsize = int(v)
self.size = (xsize, ysize)
continue
if k == 'height':
ysize = int(v)
self.size = (xsize, ysize)
continue
if k == 'pixel' and v == 'n8':
self.mode = 'L'
continue
continue
return None
Image.register_open('IMT', ImtImageFile)